//
// Runs @argv in the background. If launching @argv fails,
// this will throw an error.
-function trySpawn(argv)
-{
+function trySpawn(argv) {
var success, pid;
try {
[success, pid] = GLib.spawn_async(null, argv, null,
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._mouseTimeOutId, '[gnome-shell] this._enterItem');
- } else
+ } else {
this._itemEntered(index);
+ }
}
_enterItem(index) {
let cache = Meta.BackgroundImageCache.get_default();
let image = cache.load(file);
- if (image.is_loaded())
+ if (image.is_loaded()) {
this._setLoaded();
- else {
+ } else {
let id = image.connect('loaded', () => {
this._setLoaded();
image.disconnect(id);
return true;
}
-function _dateIntervalsOverlap(a0, a1, b0, b1)
-{
+function _dateIntervalsOverlap(a0, a1, b0, b1) {
if (a1 <= b0)
return false;
else if (b1 <= a0)
let day = 32 - new Date(newDate.getFullYear() - 1, 11, 32).getDate();
newDate = new Date(newDate.getFullYear() - 1, 11, day);
}
- }
- else {
+ } else {
newDate.setMonth(oldMonth - 1);
if (newDate.getMonth() != oldMonth - 1) {
let day = 32 - new Date(newDate.getFullYear(), oldMonth - 1, 32).getDate();
let day = 32 - new Date(newDate.getFullYear() + 1, 0, 32).getDate();
newDate = new Date(newDate.getFullYear() + 1, 0, day);
}
- }
- else {
+ } else {
newDate.setMonth(oldMonth + 1);
if (newDate.getMonth() != oldMonth + 1) {
let day = 32 - new Date(newDate.getFullYear(), oldMonth + 1, 32).getDate();
button.add_style_pseudo_class('selected');
if (this._shouldDateGrabFocus)
button.grab_key_focus();
- }
- else
+ } else {
button.remove_style_pseudo_class('selected');
+ }
});
}
};
secret.valid = secret.value.length > 0;
this._updateOkButton();
});
- } else
+ } else {
secret.valid = true;
+ }
if (rtl) {
layout.attach(secret.entry, 0, pos, 1, 1);
|| (value[i] >= 'A' && value[i] <= 'Z')))
return false;
}
- } else
+ } else {
return false;
+ }
} else if (secret.wep_key_type == NM.WepKeyType.PASSPHRASE) {
if (value.length < 0 || value.length > 64)
return false;
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
else
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.CONFIRMED);
- } else
+ } else {
this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
+ }
this.destroy();
}
if (this._restoreOnSuccess) {
this._restoreDragActor(event.get_time());
return true;
- } else
+ } else {
this._dragActor.destroy();
+ }
}
this._dragState = DragState.INIT;
if ((i + 1) % this._childrenPerPage == 0)
y += this._spaceBetweenPages - spacing + this.bottomPadding + this.topPadding;
x = box.x1 + leftEmptySpace + this.leftPadding;
- } else
+ } else {
x += this._getHItemSize() + spacing;
+ }
}
}
}
selectChild(child) {
- if (child == null)
+ if (child == null) {
this.selectIndex(-1);
- else {
+ } else {
for (let i = 0; i < this._tabs.length; i++) {
let tabData = this._tabs[i];
if (tabData.child == child) {
if (!this._crossHairs)
this.addCrosshairs();
this._crossHairs.show();
- }
- else {
+ } else {
if (this._crossHairs)
this._crossHairs.hide();
}
if (this._crossHairs) {
let clutterColor = this._crossHairs.getColor();
return clutterColor.to_string();
- }
- else
+ } else {
return '#00000000';
+ }
}
/**
if (clip) {
if (this._crossHairs)
this._crossHairs.setClip(CROSSHAIRS_CLIP_SIZE);
- }
- else {
+ } else {
// Setting no clipping on crosshairs means a zero sized clip
// rectangle.
if (this._crossHairs)
if (this._crossHairs) {
let [clipWidth, clipHeight] = this._crossHairs.getClip();
return (clipWidth > 0 && clipHeight > 0);
- }
- else
+ } else {
return false;
+ }
}
//// Private methods ////
if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PROPORTIONAL) {
return this._centerFromPointProportional(xMouse, yMouse);
- }
- else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH) {
+ } else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH) {
return this._centerFromPointPush(xMouse, yMouse);
- }
- else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED) {
+ } else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED) {
return this._centerFromPointCentered(xMouse, yMouse);
}
// mouse.
this._clipSize = size;
this.reCenter();
- }
- else {
+ } else {
// Restore the missing chunk.
this._clipSize = [0, 0];
this.reCenter();
if (proxyAndZoomRegion && proxyAndZoomRegion.zoomRegion) {
Main.magnifier.addZoomRegion(proxyAndZoomRegion.zoomRegion);
return true;
- }
- else
+ } else {
return false;
+ }
}
/**
this.toggle();
this.actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
return Clutter.EVENT_STOP;
- } else
+ } else {
return Clutter.EVENT_PROPAGATE;
+ }
}
setArrowOrigin(origin) {
flashspot.fire(() => {
this._removeShooterForSender(invocation.get_sender());
});
- }
- else
+ } else {
this._removeShooterForSender(invocation.get_sender());
+ }
}
let retval = GLib.Variant.new('(bs)', [result, filenameUsed]);
} else {
return 'network-wired-disconnected-symbolic';
}
- } else
+ } else {
return 'network-wired-disconnected-symbolic';
+ }
}
};
oldHandler.apply(eventScope, oldParams);
handler(target);
};
- } else
+ } else {
params[name] = () => { handler(target); };
+ }
}
function _actorDestroyed(target) {
if (Tweener.getTweenCount(scope) == 0)
_tweenCompleted(scope);
return true;
- } else
+ } else {
return false;
+ }
}
function pauseTweens(...args) {
// Check whether the 4th finger press happens after a 3-finger long press,
// this only needs to be checked on the first 4th finger press
if (this._longPressStartTime != null &&
- event.get_time() < this._longPressStartTime + LONG_PRESS_TIMEOUT)
+ event.get_time() < this._longPressStartTime + LONG_PRESS_TIMEOUT) {
this.cancel();
- else {
+ } else {
this._longPressStartTime = null;
this.emit('activated');
}
let focusWindow = global.display.focus_window;
let nextWindow;
- if (focusWindow == null)
+ if (focusWindow == null) {
nextWindow = windows[0].metaWindow;
- else {
+ } else {
let index = this._lookupIndex (windows, focusWindow) + 1;
if (index >= windows.length)